package io.cici.common.model;

import io.cici.common.serialize.JsonUtils;
import lombok.Data;


@Data
public class LifeCycle {

    public static final LifeCycle EMPTY_LIFE_CYCLE = new LifeCycle();

    private Long start;

    private Long end;

    public static LifeCycle parse(String lifeCycle) {
        try {
            return JsonUtils.parseObject(lifeCycle, LifeCycle.class);
        } catch (Exception e) {
            // ignore
            return EMPTY_LIFE_CYCLE;
        }
    }

}
